//
//  TextFieldPadding.swift
//  Shien
//
//  Created by yzd on 2019/4/27.
//  Copyright © 2019 尘埃. All rights reserved.
//



import UIKit

class TextFieldPadding: UITextField {
     var insets: UIEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 15)
    override func drawText(in rect: CGRect) {
        super.drawText(in: rect.inset(by: insets))
    }
    override func textRect(forBounds bounds: CGRect) -> CGRect {
        return  bounds.inset(by: insets)
    }
    
    override func placeholderRect(forBounds bounds: CGRect) -> CGRect {
        return  bounds.inset(by: insets)
        
    }
    
    override func editingRect(forBounds bounds: CGRect) -> CGRect {
        return  bounds.inset(by: insets)
    }

    
}
